﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Robin.Domain.Entities;
using Robin.NHibernate.EntityMappings;

namespace Smart.Project.Data
{
    public class MUserMap : EntityMap<MUser, string>
    {
        public MUserMap() : base("PM_USER")
        {
            Id(x => x.Id);
            References(o => o.DEPT).Not.LazyLoad().Column("DEPTID");
            References(o => o.ROLE).Not.LazyLoad().Column("ROLEID");
            Map(x => x.BMMC);
            Map(x => x.USERCODE);
            Map(x => x.USERNAME);
            Map(x => x.USERPWD);
            Map(x => x.PHONEIMEI);
            Map(x => x.DISABLED);
            Map(x => x.SEX);
            Map(x => x.BZ);
            Map(x => x.UPDATEUSER);
            Map(x => x.UPDATETIME);
            Map(x => x.CREATEUSER);
            Map(x => x.CREATETIME);
        }
    }
    /// <summary>
    /// 部门
    /// </summary>
    public class MUser : Entity<string>
    {
        ///// <summary>
        /////     关联部门
        ///// </summary>
        //public virtual string DEPTID { get; set; }
        ///// <summary>
        /////     关联角色
        ///// </summary>
        //public virtual string ROLEID { get; set; }
        /// <summary>
        ///     关联部门
        /// </summary>
        public virtual MDepartment DEPT { get; set; }
        /// <summary>
        ///     部门
        /// </summary>
        public virtual string BMMC { get; set; }
        /// <summary>
        ///     关联角色
        /// </summary>
        public virtual MRole ROLE { get; set; }
        /// <summary>
        /// 用户账号
        /// </summary>
        public virtual string USERCODE { get; set; }
        /// <summary>
        /// 用户名
        /// </summary>
        public virtual string USERNAME { get; set; }
        /// <summary>
        /// 用户密码
        /// </summary>
        public virtual string USERPWD { get; set; }
        /// <summary>
        /// 手机
        /// </summary>
        public virtual string PHONEIMEI { get; set; }
        /// <summary>
        /// 是否禁用
        /// </summary>
        public virtual string DISABLED { get; set; }
        /// <summary>
        /// 别名
        /// </summary>
        public virtual string BYNAME { get; set; }
        /// <summary>
        /// 性别
        /// </summary>
        public virtual string SEX { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public virtual string BZ { get; set; }
        /// <summary>
        /// 登录时间
        /// </summary>
        public virtual Decimal LOGINTIME { get; set; }
        ///<summary>
        /// 修改人
        /// </summary>
        public virtual string UPDATEUSER { get; set; }
        /// <summary>
        /// 记录更新时间
        /// </summary>
        public virtual Decimal UPDATETIME { get; set; }
        /// <summary>
        /// 创建人
        /// </summary>
        public virtual string CREATEUSER { get; set; }
        /// <summary>
        /// 记录创建时间
        /// </summary>
        public virtual Decimal CREATETIME { get; set; }
    }
}
